package com.test.controller;


import com.test.common.BaseResponse;
import com.test.common.ResultUtils;
import com.test.model.pojo.Word;
import com.test.service.WordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/word")
public class WordController {
    @Autowired
    WordService wordService;

    @GetMapping("/getWord")
    public BaseResponse<List<Word>> getAllWord(){
        List<Word> words = wordService.getAllWord();
        return ResultUtils.success(words);
    }
}
